function showChangePackageModal() {
    document.getElementById('changePackageModal').style.display = 'block';
}

function hideChangePackageModal() {
    document.getElementById('changePackageModal').style.display = 'none';
}

function toggleSubMenu() {
    var subMenu = document.getElementById('subMenu');
    if (subMenu.style.display === 'block') {
        subMenu.style.display = 'none';
    } else {
        subMenu.style.display = 'block';
    }
}

function checkBalanceBeforeChangePackage() {
    var balance = parseFloat('${user.balance}');
    var selectedPackage = document.querySelector('select[name="newPackage"]').value;
    var packagePrice;
    switch (selectedPackage) {
        case '1':
            packagePrice = 50;
            break;
        case '2':
            packagePrice = 60;
            break;
        case '3':
            packagePrice = 150;
            break;
        default:
            packagePrice = 0;
    }
    
    return false;
}